package com.zjn.servicec.contoller;

import com.zjn.entity.Contact;
import com.zjn.servicec.service.ContactService;
import com.zjn.servicec.service.Feign.ServiceCFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zaker
 * @program: signit_parent
 * @date 2021-04-01 11:30
 */
@RestController
public class ContactController implements ServiceCFeign {

    @Autowired
    private ContactService contactService;

    @Override
    @GetMapping("/findContactById")
    public Contact findContectById(Contact contact) {
        Short id =contact.getId();
        return contactService.findContactById(id);
    }

    @Override
    @PostMapping("/createContact")
    public String createContact(Contact contact) {
        return contactService.createContact(contact);
    }

}
